package org.winexpress

import org.codehaus.groovy.grails.web.json.JSONObject;
import org.codehaus.groovy.grails.web.json.JSONArray;
import grails.converters.JSON

class LogoutController {

    // REST operations
    // GET
    def show = {
       
        println 'LogoutController >> Show >> START'
        
        CustomerManagement cman = new CustomerManagement()
        
        if (params.username) {
            def c = cman.getCustomerByUsername(params.username)
            if (c.activationStatus == true) {
                render c as JSON
            }
            else {
                JSONObject o = new JSONObject()
                o.put("404",true)
                render o as JSON
            }
            
            println 'Show logout by USERNAME >> ' + c.id + " " + c
        }
        
        println 'LogoutController >> Show >> END'
        
    }
    
    // PUT
    
    
    // DELETE
    
    
    // POST
    
    
}
